<template>
  <div>
    <h3>{{ msg }}</h3>
    <BaseInput
      v-model="inputValue"
      placeholder="请输入内容"
    />
    <BaseButton
      label="提交"
      :is-primary="true"
      @onClick="handleSubmit"
    />
    <BaseCard header="卡片标题">
      <template #header>自定义标题</template>
      <p>这是卡片的内容。</p>
      <template #footer>
        <BaseButton label="关闭" />
      </template>
    </BaseCard>
  </div>
</template>

<script>
import { defineComponent, ref } from 'vue';
import BaseButton from './BaseButton.vue';
import BaseInput from './BaseInput.vue';
import BaseCard from './BaseCard.vue';

export default defineComponent({
  name: 'HelloWorld',
  props: {
    msg: String,
  },
  components: {
    BaseButton,
    BaseInput,
    BaseCard,
  },
  setup() {
    const inputValue = ref('');

    const handleSubmit = () => {
      console.log('提交的值:', inputValue.value);
    };

    return {
      inputValue,
      handleSubmit,
    };
  },
});
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #b99142;
}
</style>